package xdu.lz.stage2_design_pattern.chapter3_observer_pattern.observerApp1;


public abstract class Observer {

    //维护着一个主题
    protected Subject subject;

    public Observer(Subject subject) {
        this.subject = subject;
        //把当前观察者加入到主题中
        this.subject.attach(this);
    }

    public abstract void update();
}
